import request from '@/utils/request'
// 获取管理用户分页列表
export function getPageList(page,limit,username){
    return request({
      url: `/admin/acl/user/${page}/${limit}`,
      method: "get",
      params:username
    });
  }

// 根据用户获取角色数据
export function getUserId(userId){
    return request({
        url:`/admin/acl/user/toAssign/${userId}`,
        method: "get",
    })
}

//点击添加用户
export function getAddUser(userForm){
  return request({
    url:'/admin/acl/user/save',
    method:'post',
    data:userForm
  })
}
//点击修改
export function UPdata(userForm){
  return request({
    url:'/admin/acl/user/update',
    method:'put',
    data:userForm
  })
}

//点击删除单个
// DELETE 
export function getDelete(id){
  return request({
    url:`/admin/acl/user/remove/${id}`,
    method:'delete',
  })
}

//点击删除多个
export function getAllDeleteData(ids){
  return request({
    url:'/admin/acl/user/batchRemove/',
    method:'delete',
    data:ids
  })
}
//用户分配角色
export function assignUserRoleListApi(userId,roleId){
  return request({
    url:'/admin/acl/user/doAssign',
    method:'post',
    params:{userId,roleId}
  })
}
